package com.alex.controller;

import com.alex.mapper.TbDictionaryMapper;
import com.alex.model.pojo.TbDictionary;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Example;

@RestController
public class TestController {

    @Autowired
    private TbDictionaryMapper tbDictionaryMapper;

    @GetMapping("/dic/list")
    public List<TbDictionary> list(){
        Example example = new Example(TbDictionary.class);
        example.createCriteria()
            .andEqualTo("enableFlag",true);
//        return tbDictionaryMapper.selectAll();
        return tbDictionaryMapper.selectByExample(example);
    }

}
